package factory.pattern.demo;

public class ConCreateFactory extends IAnimalFactroy {
    @Override
    public  IAnimal getAnimalType(String animals) throws Exception {
        switch (animals) {
            case "Duck":
                return new Duck();
            case "Tiger":
                return new Tiger();
            default:
                throw new Exception("Animal type: " + animals + "cannot the instantiated");
        }

    }
}
